%%
%% This is file `dtx-style.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% njuthesis.dtx  (with options: `dtx-style')
%% This is a generated file.
%% 
%% Copyright (C) 2013-2017, Haixing Hu.
%% Department of Computer Science and Technology, Nanjing University.
%% Copyright (C) 2018-2020, Zachary Cao.
%% School of Physics, Nanjing University.
%% 
%% Home Page of the Project: http://haixing-hu.github.io/nju-thesis/
%% 
%% It may be distributed and/or modified under the conditions of the LaTeX Project
%% Public License, either version 1.2 of this license or (at your option) any
%% later version.  The latest version of this license is in
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%% 
%% This is the manual-style file of the njuthesis package with XeLaTeX.
\RequirePackage{etoolbox}
\ProvidesPackage{dtx-style}
\RequirePackage{amssymb}
\RequirePackage{calc}
\RequirePackage{array,longtable}
\RequirePackage{fancybox,fancyvrb}
\RequirePackage{xcolor}
\RequirePackage{xltxtra}
\RequirePackage{subfigure}
\RequirePackage{marvosym}
\RequirePackage{booktabs}
\RequirePackage{paralist}
\RequirePackage{enumitem}
\RequirePackage{titlesec}
\RequirePackage{titling}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{indentfirst}
\RequirePackage[fontset=fandol]{ctex}
\RequirePackage{newtxtext,newtxmath}
\RequirePackage[hyphens]{url} % must be load before hypdoc package
\RequirePackage{hypdoc} % it will load hyperref package
\RequirePackage[normalem]{ulem}
\hypersetup{%
    unicode=false,
    hyperfootnotes=true,
    hyperindex=true,
    pageanchor=true,
    CJKbookmarks=true,
    bookmarksnumbered=true,
    bookmarksopen=true,
    bookmarksopenlevel=0,
    breaklinks=true,
    colorlinks=false,
    plainpages=false,
    pdfpagelabels,
    pdfborder=0 0 0%
}

\newcommand{\env}[1]{\texttt{#1}}

\hypersetup{colorlinks=true,urlcolor=blue}

\renewcommand{\contentsname}{目\hspace{2em}录}
\renewcommand{\abstractname}{摘\hspace{2em}要}
\renewcommand{\indexname}{索\hspace{2em}引}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\refname}{参考文献}

\setlength{\parskip}{4pt plus1pt minus0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\parindent}{2em}
\addtolength{\oddsidemargin}{-1cm}
\advance\textwidth 1.5cm
\addtolength{\topmargin}{-1cm}
\addtolength{\headsep}{0.3cm}
\addtolength{\textheight}{2.3cm}

\newcommand{\zhdash}{\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex}

\renewcommand{\baselinestretch}{1.3}

\DefineVerbatimEnvironment{shell}{Verbatim}%
  {frame=single,framerule=0.1mm,rulecolor=\color{black},%
   framesep=2mm,fontsize=\small,gobble=1}

\DefineVerbatimEnvironment{example}{Verbatim}%
  {frame=single,framerule=0.1mm,rulecolor=\color{black},%
   framesep=2mm,baselinestretch=1.2,fontsize=\small,gobble=1}

\long\def\myentry#1{\vskip5pt\par\noindent\llap{{\color{blue}\fangsong #1}}%
  \marginpar{\strut}\hskip\parindent}

\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\large\bfseries}
\titleformat*{\subsubsection}{\normalsize\bfseries}
\titleformat*{\paragraph}{\normalsize\bfseries}
\titleformat*{\subparagraph}{\normalsize\bfseries}

\pretitle{\begin{center}\huge\bfseries}
\posttitle{\par\end{center}\vskip 1em}
\preauthor{\begin{center}
             \large \lineskip 0.5em}
\postauthor{\par\end{center}}
\predate{\begin{center}\large}
\postdate{\par\end{center}}

\renewcommand{\tableofcontents}{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \section*{\hfill\contentsname\hfill}%
    \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
}

\newcolumntype{C}[1]{>{\centering\let\newline\\%
    \arraybackslash\hspace{0pt}}p{#1}}

\font\manfnt=manfnt
\newcommand*{\dangericon}{\manfnt\char127}

\newenvironment{note}
               {\vskip1.5ex\par\noindent\llap{\dangericon\hskip2mm}\textbf{注意：}}
               {\vskip1.5ex}

\newenvironment{syntax}
               {\begin{center}}
               {\end{center}}

\newenvironment{suggestion}
               {\par\noindent\textbf{建议：}}{}

\setlist{%
  topsep=0.3em,             % 列表顶端的垂直空白
  partopsep=0pt,            % 列表环境前面紧接着一个空白行时其顶端的额外垂直空白
  itemsep=0ex plus 0.1ex,   % 列表项之间的额外垂直空白
  parsep=0pt,               % 列表项内的段落之间的垂直空白
  leftmargin=1.5em,           % 环境的左边界和列表之间的水平距离
  rightmargin=0em,          % 环境的右边界和列表之间的水平距离
  labelsep=0.5em,           % 包含标签的盒子与列表项的第一行文本之间的间隔
  labelwidth=2em,           % 包含标签的盒子的正常宽度；若实际宽度更宽，则使用实际宽度。
}

\setlist[itemize,1]{label=$\bullet$}
\setlist[itemize,2]{label=$\blacksquare$}
\setlist[itemize,3]{label=$\Diamondblack$}

\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  \hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

\geometry{headheight=2.6cm,headsep=3mm,footskip=13mm}
\geometry{top=3.5cm,bottom=3.5cm,left=3.2cm,right=3.2cm}

\newcommand*{\std}[1]{{\normalfont #1}}

%% \newcommand{\env}[1]{\texttt{#1}}

\makeatletter
\renewcommand*{\tableofcontents}{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \section*{\hfill\contentsname\hfill}%
    \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
    \addcontentsline{toc}{section}{\contentsname}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
}
\makeatother

\IndexPrologue{\clearpage\section*{\hfill\indexname\hfill}%
\markboth{\indexname}{\indexname}%
\addcontentsline{toc}{section}{\indexname}%
斜体数字表示对应项的描述所在页面的页码， %
带下划线的数字表示对应项的定义所在的代码行号，%
其他数字表示对应项所被引用的代码行号。%
}

\setcounter{IndexColumns}{2}

\newcommand{\dashnumber}[2]%
  {{#1}\kern.07em\rule[.5ex]{.4em}{.1ex}\kern.07em{#2}}

\endinput
%%
%% End of file `dtx-style.sty'.
